#!/bin/bash -e
# R1BNC
# Compile and Flash ESP8266_MP3_DECODER for NodeMCU devkit v1.0
make clean
make COMPILE=gcc BOOT=none APP=0 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE=4096
#make COMPILE=gcc BOOT=none APP=0 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE=1024
#${ESPTOOL} --port ${ESPPORT} --baud ${ESPBAUD} write_flash 0x00000 ../bin/eagle.flash.bin 0xA0000 ../bin/eagle.irom0text.bin
#460800
esptool.py --port /dev/ttyUSB0 erase_flash
esptool.py --port /dev/ttyUSB0 --baud 115200 write_flash -fs 4MB -fm dout -ff 40m  0x00000 ../bin/eagle.flash.bin 0xA0000 ../bin/eagle.irom0text.bin

